<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
     <!-- 开发环境版本，包含了有帮助的命令行警告 -->
     <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        {{message}}
        <div style="color: blue;">
        {{show}}
        </div>

    </div>
    <script>
        var app = new Vue({
        el: '#app',
        data: {
          message: "我的Vue程序!" ,
          show:"欢迎来到我的世界"
        }
      });
    </script>
    <div id="app-2">
        <ol>
          <li v-for="todo in todos">
            {{ todo.text }}
          </li>
        </ol>
      </div>
      <script>
      var app4 = new Vue({
        el: '#app-2',
        data: {
          todos: [
            { text: '学习 JavaScript' },
            { text: '学习 Vue' },
            { text: '整个牛项目' }
          ]
        }
      })
    </script>
    <div id="app-8">
        <ol>
          <li v-for="todo in todos">
            {{ todo }}
          </li>
        </ol>
      </div>
      <script>
      var app8 = new Vue({
        el: "#app-8",
        data: {
          todos: ['你好','嗯','哈','剁']
        }
      })
       </script>
    <div id="app-3">
        <p>{{ message }}</p>
        <button v-on:click="reverseMessage">反转消息</button>
      </div>
      <script>
          var app5 = new Vue({
            el: '#app-3',
            data: {
            message: 'Hello Vue.js!'
        },
            methods: {
        reverseMessage: function () {
        this.message = this.message.split('').reverse().join('')
    }
  }
})
      </script>
      <div id="app-4">
       <span :title="message">
           鼠标悬停几秒钟查看此处动态绑定的提示信息!
       </span>
        <span :style="'color:' +color+ ';'">能变颜色的内容</span>
    </div>
    <script>
        var app = new Vue({
        el: '#app-4',
        data: {
          message: "这里是Vue的内容!" ,
          color: "red"
        }
      });
      </script>
</body>
</html>